<!--

生成最基本的Restful模板页面

顶部有按（门店、时间段*）查询 添加按钮

包含一个 ag-grid 列表，默认表头只有一行，每列都可查询，默认每条最后有打开、删除按钮

有新增、修改弹出层
-->

<div class="view-header">
    <div class="view-header-left ">
        <div ng-show="!add_open">
            <div class="search-shop">
                <i class="fa fa-home"></i>
                <shop-picker class="from-control"
                             shop="search_params.shop"></shop-picker>
            </div>

            <div class="search-date">
                <i class="fa fa-calendar search-date-i"></i>
                <datetimepicker class="search-date-start"
                                min-view="2"
                                end-date="search_params.date_end"
                                ng-model="search_params.date_start"></datetimepicker>

            </div>
            <div class="search-date">
                <i class="fa fa-calendar search-date-i"></i>
                <datetimepicker class="search-date-end"
                                min-view="2"
                                start-date="search_params.date_start"
                                ng-model="search_params.date_end"></datetimepicker>
            </div>

        </div>
        <div class="view-header-left">
            <div class="view-header-item no-widen"
                 ng-show="!place_order_open&&!add_cover"
                 ng-click="refresh()" title="查询">
                <i class="fa fa-search"></i>
            </div>

            <div class="view-header-item color-open"
                 ng-show = "!add_open"
                 ng-click="open_add()" title="新增试驾记录" >
                <i class="fa fa-plus"></i> 新增记录
            </div>

            <!-- add -->
            <div class="view-header-item color-open above-cover no-widen"
                 ng-show = "add_open"
                 ng-click= "add_open = false" title="关闭" >
                <i class="fa fa-close"></i>
            </div>

            <div class="view-header-item color-check above-cover no-widen"
                 ng-show = "add_open"
                 ng-click= "submit_add()" title="提交" >
                <i class="fa fa-upload"></i>
            </div>
        </div>
    </div>

</div>
<div class="view-content ">
    <div ag-grid="grid" class="ag-material"
         style="height :100%"></div>
</div>

<!-- add 试驾记录 -->
<div class="data-overlay" ng-show ='add_open'>
    <div class="overlay-container">
        <div class="overlay-header">添加试驾记录</div>
        <div ng-form name="record_add" novalidate="novalidate">
            <div class="overlay-content">
                <div class="overlay-column overlay-column-3">
                    <div class="overlay-item">
                        <span class="overlay-name">选择门店</span>
                        <shop-picker  shop="record_add.shop"></shop-picker>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">选择试驾车</span>
                        <vehicle-demo-picker
                                shop="record_add.shop"
                                ng-model="record_add.vehicle_demo" ></vehicle-demo-picker>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">驾驶员</span>
                        <input type="text" ng-model="record_add.test_driver" >
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">起始公里数</span>
                        <input type="number" ng-model="record_add.vehicle_demo.mileage" disabled>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">结束公里数</span>
                        <input type="number" step="0.1" min="{{record_add.vehicle_demo.mileage}}"
                               ng-model="record_add.mileage_after">
                    </div>

                    <div class="overlay-item">
                        <span class="overlay-name">开始时间</span>
                        <datetimepicker format="hh:ii"
                                        start-view="1"
                                        start-date="record_add.arrive_time"
                                        end-date="record_add.test_end_time"
                                        ng-model="record_add.test_start_time"></datetimepicker>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">结束时间</span>
                        <datetimepicker format="hh:ii"
                                        start-view="1"
                                        start-date="record_add.test_start_time"
                                        ng-model="record_add.test_end_time"></datetimepicker>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">备注</span>
                        <input type="text" name="" ng-model="record_add.remark">
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
